VERSION 5.00
Begin VB.Form frmPollSettings 
   Caption         =   "Poll Settings"
   ClientHeight    =   2310
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   9720
   Icon            =   "frmPollSettings.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   2310
   ScaleWidth      =   9720
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton cmdDirLog 
      Height          =   330
      Left            =   9000
      Picture         =   "frmPollSettings.frx":0442
      Style           =   1  'Graphical
      TabIndex        =   7
      Top             =   840
      Width           =   420
   End
   Begin VB.TextBox txtLogPath 
      Height          =   285
      Left            =   1800
      TabIndex        =   6
      Top             =   840
      Width           =   7095
   End
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "&Cancel"
      Height          =   315
      Left            =   7440
      TabIndex        =   4
      Top             =   1680
      Width           =   1095
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "&OK"
      Default         =   -1  'True
      Height          =   315
      Left            =   6240
      TabIndex        =   3
      Top             =   1680
      Width           =   1035
   End
   Begin VB.PictureBox Picture1 
      Height          =   555
      Left            =   240
      ScaleHeight     =   495
      ScaleWidth      =   2595
      TabIndex        =   0
      Top             =   120
      Width           =   2655
      Begin VB.TextBox txtPolTimeInt 
         Height          =   285
         Left            =   960
         TabIndex        =   2
         Top             =   120
         Width           =   675
      End
      Begin VB.Label Label2 
         Caption         =   "minute(s)."
         Height          =   195
         Left            =   1740
         TabIndex        =   5
         Top             =   180
         Width           =   735
      End
      Begin VB.Label Label1 
         Caption         =   "Poll every "
         Height          =   255
         Left            =   120
         TabIndex        =   1
         Top             =   120
         Width           =   915
      End
   End
   Begin VB.PictureBox Picture2 
      Height          =   615
      Left            =   240
      ScaleHeight     =   555
      ScaleWidth      =   9195
      TabIndex        =   8
      Top             =   720
      Width           =   9255
      Begin VB.Label Label15 
         Caption         =   "Log File Path:"
         Height          =   255
         Left            =   120
         TabIndex        =   9
         Top             =   120
         Width           =   1575
      End
   End
End
Attribute VB_Name = "frmPollSettings"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public blnCancel As Boolean
Private Sub cmdCancel_Click()
    blnCancel = True
    Unload Me
End Sub



Private Sub cmdDirLog_Click()
    On Error GoTo cmdDir_ClickFix

    If txtLogPath.Text <> "" Then
        If Dir(txtLogPath.Text, vbDirectory) <> "" Then
            '
             frmDir.Drive1.Drive = Left(txtLogPath.Text, 1)
             frmDir.Dir1.Path = txtLogPath.Text
        End If
    Else
        'frmDir.Drive1.Drive = CurDir 'application directory
        frmDir.Drive1.Drive = "C:\"
        frmDir.Dir1.Path = "C:\"
    End If
    frmDir.Show vbModal
    If Not frmDir.blnCancelled Then
        If ValidateFolder(frmDir.strDir, True) Then
            Me.txtLogPath.Text = frmDir.strDir
        End If
    Else
        Me.txtLogPath.Text = ""
    End If
    Exit Sub
    
cmdDir_ClickFix:
    If Err.Number = 52 Then
        'selected device is not available eg e:\
        frmDir.Drive1.Drive = "C:\"
        frmDir.Dir1.Path = "C:\"
    Else
        MsgBox "cmdDir_Click: " & Err.Number & " - " & Err.Description, vbExclamation, "KeyTax Interface"
    End If
End Sub

Private Sub cmdOK_Click()

    Dim strLogPath As String
    Dim i As Integer
    Dim blnNullsFound As Boolean

    On Error GoTo cmdOkFix
    
    strLogPath = txtLogPath.Text
    
    If Not CheckTimeInterval(txtPolTimeInt.Text) Then
        txtPolTimeInt.SetFocus
        Beep
    Else
'        txtPolTimeInt.Text = txtPolTimeInt.Text * 1000 'seconds
'        txtPolTimeInt.Text = txtPolTimeInt.Text * 60
        objReg.PolTimeInterval = txtPolTimeInt.Text
        lngCounter = 0
    End If
                
    If ValidateFolder(strLogPath, True) Then
        objReg.LogFilePath = strLogPath
    End If
                                
    Unload Me
    
    Exit Sub
    
cmdOkFix:
    MsgBox "cmdOk: " & Err.Number & " - " & Err.Description, vbExclamation, "ReceiveXML"
End Sub



Private Sub Form_Activate()
    txtPolTimeInt.SetFocus
End Sub

Private Sub Form_Load()

            
    blnCancel = False
    
    txtPolTimeInt.Text = objReg.PolTimeInterval
    txtLogPath.Text = objReg.LogFilePath
           
        
End Sub


Private Sub txtPolTimeInt_GotFocus()
    txtPolTimeInt.SelStart = 0
    txtPolTimeInt.SelLength = Len(txtPolTimeInt.Text)
End Sub
